<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Hard
  </div>
  <div>
   <h1 class="question_title">
    600. Non-negative Integers without Consecutive Ones
   </h1>
   <p>
    Given a positive integer n, find the number of
    <b>
     non-negative
    </b>
    integers less than or equal to n, whose binary representations do NOT contain
    <b>
     consecutive ones
    </b>
    .
   </p>
   <p>
    <b>
     Example 1:
    </b>
    <br>
   </p>
   <pre>
<b>Input:</b> 5
<b>Output:</b> 5
<b>Explanation:</b> 
Here are the non-negative integers &lt;= 5 with their corresponding binary representations:
0 : 0
1 : 1
2 : 10
3 : 11
4 : 100
5 : 101
Among them, only integer 3 disobeys the rule (two consecutive ones) and the other 5 satisfy the rule. 
</pre>
   <p>
    <b>
     Note:
    </b>
    1 &lt;= n &lt;= 10
    <sup>
     9
    </sup>
   </p>
  </div>
  <div>
   <h1 class="question_title">
    600. 不含连续1的非负整数
   </h1>
   <p>
    给定一个正整数 n，找出小于或等于 n 的非负整数中，其二进制表示不包含&nbsp;
    <strong>
     连续的1&nbsp;
    </strong>
    的个数。
   </p>
   <p>
    <strong>
     示例 1:
    </strong>
   </p>
   <pre><strong>输入:</strong> 5
<strong>输出:</strong> 5
<strong>解释:</strong> 
下面是带有相应二进制表示的非负整数&lt;= 5：
0 : 0
1 : 1
2 : 10
3 : 11
4 : 100
5 : 101
其中，只有整数3违反规则（有两个连续的1），其他5个满足规则。</pre>
   <p>
    <strong>
     说明:
    </strong>
    1 &lt;= n &lt;= 10
    <sup>
     9
    </sup>
   </p>
  </div>
 </body>
</html>